method of interpolation using newtons method